# https://gitee.com/yueyinqiu5990/codes-for-tj10053104/blob/master/supplement1/question9/main.py

def _main():
    input_string = input("输入二进制串:")
    a_b_string = input_string.replace("0", "A").replace("1", "B")
    print("结果字符串：", a_b_string)
    print("结果串长度：", len(a_b_string))

    ab_index = a_b_string.find("AB")
    print("第一次AB位置：", ab_index if ab_index != -1 else "无")

    a_x_y_string = a_b_string.replace("B", "XY")
    print("替换结果：", a_x_y_string)
    print("小写字符串：", a_x_y_string.lower())


if __name__ == "__main__":
    _main()
